# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Contributor: Lennard Hofmann

pkgname=wf-recorder
pkgver=0.4.1
pkgrel=1
pkgdesc="Screen recorder for wlroots-based compositors such as sway"
arch=("loong64" "x86_64")
url="https://github.com/ammen99/wf-recorder"
license=('MIT')
depends=(
	'libavcodec.so'
	'libavdevice.so'
	'libavfilter.so'
	'libavformat.so'
	'libavutil.so'
	'libpulse.so'
	'libpulse-simple.so'
	'libswresample.so'
	'libwayland-client.so'
)
makedepends=(
	'meson'
	'wayland-protocols'
)
optdepends=(
	'slurp: Select a region to record'
)
source=("$pkgname-$pkgver.tar.gz::https://github.com/ammen99/wf-recorder/archive/v$pkgver.tar.gz")
sha256sums=('486e9c03693026e7e287e9cddda5b78488b22706aed1ab789e19ffd09e4adfda')

build() {
	meson "$pkgname-$pkgver" build \
		-Dpulse=enabled \
		--prefix=/usr \
		--buildtype=plain
	ninja -C build
}

package() {
	DESTDIR="$pkgdir/" ninja -C build install
	cd "$pkgname-$pkgver"
	install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}
